package com.pan.service;

import com.pan.entity.Result;
import com.pan.vo.AdminRegisterVo;
import com.pan.vo.AdminVo;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.InvocationTargetException;

public interface AdminService {


    Result register(String adminTicket, AdminRegisterVo adminRegisterVo);

    Result toLogin(HttpServletRequest request, HttpServletResponse response, Long tel, String password);

    @Transactional
    Result<String> login(Long tel, String password);

    Result<AdminVo> selectByTel(String adminTicket, Long tel);

    @Transactional
    Result updatePassword(String adminTicket, String oldPassword, String newPassword) throws NoSuchFieldException, InvocationTargetException, NoSuchMethodException, IllegalAccessException;

    @Transactional
    abstract Result updateInfo(String adminTicket, String memberName, Object value) throws NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    Result logoff(HttpServletResponse response, String adminTicket);
}
